<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var dateTarget = new Date("2017-5-1 17:30:20");
        var dateNow = new Date();
        var target = dateTarget.getTime();
        var now = dateNow.getTime();
        console.log(target);
        console.log(now);
    </script>
</body>
</html>